import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

// 动态路由
export const asyncRoutes = [
  // 默认页面路由
  { path: '/', redirect: '/derik' },
  // 首页
  { path: '/layout',
    component: () => import('@/layout'),
    children: [
      // 帝可得首页
      { path: '/derik', component: () => import('@/views/Derik') },
      // 工单管理
      { path: '/workOrder',
        component: () => import('@/views/WorkOrder'),
        children: [
          // 运营工单
          { path: 'operation', component: () => import('@/views/WorkOrder/components/Operation') },
          // 运维工单
          { path: 'oandm', component: () => import('@/views/WorkOrder/components/OandM') }
        ]
      },
      // 点位管理
      { path: '/Point',
        component: () => import('@/views/Point'),
        children: [
          // 区域管理 Region Point Partners
          { path: 'region', component: () => import('@/views/Point/components/Region') },
          // 点位管理
          { path: 'point', component: () => import('@/views/Point/components/Point') },
          // 合作商管理
          { path: 'partners', component: () => import('@/views/Point/components/Partners') }
        ]
      },
      // 设备管理
      { path: '/Equipment',
        component: () => import('@/views/Equipment'),
        children: [
          // 设备管理 device deviceStatus deviceType
          { path: 'device', component: () => import('@/views/Equipment/components/Device') },
          // 设备状态
          { path: 'deviceStatus', component: () => import('@/views/Equipment/components/DeviceStatus') },
          // 设备类型管理
          { path: 'deviceType', component: () => import('@/views/Equipment/components/DeviceType') }
        ]
      },
      // 人员管理
      { path: '/People',
        component: () => import('@/views/People'),
        children: [
          // 人员列表 ListOfPeople HumanEffects AListOfWorkloads
          { path: 'listOfPeople', component: () => import('@/views/People/components/ListOfPeople') },
          // 人效统计
          { path: 'humanEffects', component: () => import('@/views/People/components/HumanEffects') },
          // 工作量列表
          { path: 'aListOfWorkloads', component: () => import('@/views/People/components/AListOfWorkloads') }
        ]
      },
      // 商品管理
      { path: '/Merchandise',
        component: () => import('@/views/Merchandise'),
        children: [
          // 商品类型 ProductType Merchandise
          { path: 'productType', component: () => import('@/views/Merchandise/components/ProductType') },
          // 商品管理
          { path: 'merchandise', component: () => import('@/views/Merchandise/components/Merchandise') }
        ]
      },
      // 策略管理
      { path: '/Policy', component: () => import('@/views/Policy') },
      // 订单管理
      { path: '/Order', component: () => import('@/views/Order') },
      // 对账统计
      { path: '/Reconciliation', component: () => import('@/views/Reconciliation') }
    ]
  }

]

export default asyncRoutes

